/* GUI CONVERTED from rcrspeg.p (converter v1.75) Thu Jul 12 22:24:18 2001 */
/* rcrspeg.p - RSS REQUIREMENT PEGGING                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                    */
/* All rights reserved worldwide.  This is an unpublished work.           */
/* $Revision: 1.6.1.10 $                                                         */
/*V8:ConvertMode=Maintenance                                              */
/* REVISION: 8.6    LAST MODIFIED: 09/20/96     BY: TSI *K005*            */
/* REVISION: 8.6    LAST MODIFIED: 12/05/96     BY: *K02F* Chris Theisen  */
/* REVISION: 8.6    LAST MODIFIED: 06/18/97     BY: *K0F5* Taek-Soo Chang */
/* REVISION: 8.6    LAST MODIFIED: 06/02/98     BY: *K1QW* Alfred Tan     */
/* REVISION: 8.6    LAST MODIFIED: 01/12/99     BY: *J37V* Seema Varma    */
/* REVISION: 9.0    LAST MODIFIED: 03/29/99     BY: *J3BM* Reetu Kapoor   */
/* REVISION: 9.0    LAST MODIFIED: 04/23/99     BY: *K20L* Anup Pereira   */
/* REVISION: 9.1    LAST MODIFIED: 10/29/99     BY: *L0KS* Santosh Rao    */
/* REVISION: 9.1    LAST MODIFIED: 11/12/99     BY: *K22Q* J. Fernando    */
/* REVISION: 9.1    LAST MODIFIED: 12/02/99     BY: *L0M0* Manish K.      */
/* REVISION: 9.1    LAST MODIFIED: 03/28/00     BY: *K25V* Surekha Joshi  */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00     BY: *N0KP* myb            */
/* $Revision: 1.6.1.10 $    BY: Sandeep P.     DATE: 06/29/01 ECO: *M1CR*          */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/** TO IMPROVE PERFORMANCE                            **/
/** TO REMOVE ORACLE ERROR : DIVISOR IS EQUAL TO ZERO **/

{mfdeclre.i}

{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/*INPUT PARAMETERS*/
define input parameter abs_recid as recid no-undo.
define input parameter peg_fifo as logical no-undo.
define input parameter due_date  as date no-undo.
define input parameter due_date1 as date no-undo.
define input parameter due_time  like schd_time no-undo.
define input parameter due_time1 like schd_time no-undo.
define input parameter ref       like schd_reference no-undo.
define input parameter ref1      like schd_reference no-undo.

/*OUTPUT PARAMETERS*/
define output parameter errors as logical no-undo.

/*LOCAL VARIABLES*/
define variable work_qty as decimal no-undo.
define variable shipid as character no-undo.
define variable old_absr_id as character no-undo.
define variable new_all_qty as decimal no-undo.
define variable tot_all_qty as decimal no-undo.
define variable net_req as decimal no-undo.
define variable bump_qty as decimal no-undo.
define variable ship_cmplt as decimal no-undo.
define variable errlevel as integer no-undo.
define variable msgtext  as character no-undo.
define variable first_schd as logical no-undo.
define variable undotran like mfc_logical no-undo.
define variable l_delproc like mfc_logical no-undo.

/*WORKFILES*/
{rcwabsdf.i new}

/*BUFFERS*/
define buffer absmstr for abs_mstr.

for first abs_mstr
   fields (abs_id)
   where recid(abs_mstr) = abs_recid no-lock:
end. /* FOR FIRST abs_mstr */

assign
   shipid = abs_id
   errors = no.

for each work_abs_mstr
exclusive-lock:
   delete work_abs_mstr.
end.

/***********************************************************/
/* CREATE SHIPPER WORKFILE SUBSET OF THE ABS_MSTR.         */
/***********************************************************/
{gprun.i ""rcsoisa.p"" "(input abs_recid)"}
/*GUI*/ if global-beam-me-up then undo, leave.


MAIN:
for each work_abs_mstr
   where abs_id begins "i"
no-lock
break by abs_order
      by abs_line
      by abs__qad04
      by abs_par_id:
/*GUI*/ if global-beam-me-up then undo, leave.


   if errlevel > 2
   then do:

      {gprun.i ""rcctwbu1.p"" "(input abs_recid,
                                input yes,
                                input yes,
                                input l_delproc,
                                output undotran)"}
/*GUI*/ if global-beam-me-up then undo, leave.


      if undotran
      then
         return.

      find abs_mstr
         where recid(abs_mstr) = abs_recid
      exclusive-lock.

      delete abs_mstr.

      return.
   end.

   for first so_mstr
      fields (so_bump_all so_cum_acct so_nbr so_sched
              so_ship so_ship_cmplt so_site)
      where so_nbr = abs_order no-lock:
   end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* FOR FIRST so_mstr */

   if not so_sched
   then
      next.

   /* CREATE mfc_ctrl RECORD IF USER HAS NEVER VISITED */
   /* THE CUSTOMER SCHEDULES CONTROL FILE.             */
   if not can-find (mfc_ctrl
                    where mfc_field = "rcc_cum_peg")
   then do:
      create mfc_ctrl.
      assign
         mfc_label   = getTermLabel("AUTOMATIC_CUM_PEGGING",28)
         mfc_field   = "rcc_cum_peg"
         mfc_seq     = 19
         mfc_module  = "rc"
         mfc_type    = "L"
         mfc_logical = yes.
   end. /*IF NOT CAN-FIND */

   /* CUMULATIVE SCHEDULE ORDER DOES NOT CREATE THE PEGGING */
   /* RECORDS WHEN AUTOMATIC CUM PEGGING FLAG IS SET TO NO  */
   /* IN CUSTOMER SCHEDULES CONTROL FILE.                   */
   if (can-find (mfc_ctrl
                 where mfc_field = "rcc_cum_peg"
                 and not mfc_logical))
   and so_cum_acct
   then
      next.

   for first sod_det
      fields (sod_cum_qty sod_curr_rlse_id sod_line sod_nbr)
      where sod_nbr  = abs_order
      and   sod_line = integer(abs_line) no-lock:
   end. /* FOR FIRST sod_det */

   assign
      ship_cmplt  = if so_ship_cmplt = 0 then 100 else so_ship_cmplt
      first_schd  = true
      new_all_qty = if first-of(abs_line) then 0 else new_all_qty
      tot_all_qty = if first-of(abs_line) then 0 else tot_all_qty
      work_qty    = abs_qty.

   /********************************************************/
   /* SCHEDULED ORDER USES CUMULATIVE QTY ACCOUNTING       */
   /********************************************************/
   if so_cum_acct
   then do:

      /*****************************************************/
      /* IF FIRST OCCURANCE OF ORDER/LINE THEN ACCUMULATE  */
      /* QTY PEGGED TO THIS SHIPPER.                       */
      /*****************************************************/
      if first-of(abs_line)
      then do:

         /* ORDER OF THE FIELDS HAS BEEN CHANGED TO MATCH THE NEW INDEX   */
         /* CREATED IN THE SCHEMA.                                        */

         for each schd_det
            fields (schd_all_qty schd_cum_qty schd_date
                    schd_discr_qty schd_interval schd_line
                    schd_nbr schd_reference schd_rlse_id
                    schd_ship_qty schd_time schd_type)
            where schd_type      = 3
              and schd_nbr       = sod_nbr
              and schd_line      = sod_line
              and schd_rlse_id   = sod_curr_rlse_id[3]
              and schd_all_qty   <> 0
            no-lock,
            each absr_det
               fields (absr_cnfrmd absr_date absr_id
                       absr_interval absr_line absr_nbr absr_qty
                       absr_reference absr_rlse_id absr_shipfrom
                       absr_ship_id absr_time absr_type)
               where absr_cnfrmd    = no
                 and absr_type      = schd_type
                 and absr_nbr       = schd_nbr
                 and absr_line      = schd_line
                 and absr_rlse_id   = schd_rlse_id
                 and absr_date      = schd_date
                 and absr_time      = schd_time
                 and absr_interval  = schd_interval
                 and absr_reference = schd_reference
         no-lock:

            assign
               new_all_qty = if absr_ship_id = shipid
                             then new_all_qty + absr_qty
                             else new_all_qty
               tot_all_qty = tot_all_qty + absr_qty.

         end. /* FOR EACH schd_det */
      end. /* IF FIRST-OF(abs_line) */

      /*****************************************************/
      /* DYNAMIC UNPEGGING ENABLED                         */
      /*****************************************************/

      /* IGNORE THE DYNAMIC UNPEG WHEN DOING THE AUTOMATIC FIFO    */
      /* PEGGING DURING THE SHIPPER LINE CREATION IN P/S WORKBENCH */

      if so_bump_all and execname <> "rcshwb.p"
      then

      repeat while work_qty > 0:
/*GUI*/ if global-beam-me-up then undo, leave.


         if first_schd
         then
            find first schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and schd_cum_qty - sod_cum_qty[1] - new_all_qty > 0
            exclusive-lock no-error.
         else
            find next schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and schd_cum_qty - sod_cum_qty[1] - new_all_qty > 0
            exclusive-lock no-error.

         first_schd = false.
         if available schd_det
            and schd_all_qty <> 0
         then do:

            bump_qty   = work_qty.

            for each absr_det
               where absr_cnfrmd    = no
                 and absr_type      = schd_type
                 and absr_nbr       = schd_nbr
                 and absr_line      = schd_line
                 and absr_rlse_id   = schd_rlse_id
                 and absr_date      = schd_date
                 and absr_time      = schd_time
                 and absr_interval  = schd_interval
                 and absr_reference = schd_reference
                 and absr_ship_id   <> shipid
            exclusive-lock
            by absr_ship_id:

               assign
                  schd_all_qty = max(schd_all_qty - absr_qty,0)
                  bump_qty     = max(bump_qty - absr_qty,0).

               delete absr_det.

               if bump_qty = 0
               then
                  leave.

            end. /* FOR EACH absr_det */

            /***********************************************/
            /* REQUIREMENT FOUND - PEG IT                  */
            /***********************************************/
            create absr_det.
            assign
               absr_shipfrom  = abs_shipfrom
               absr_id        = abs_id
               absr_type      = schd_type
               absr_nbr       = schd_nbr
               absr_line      = schd_line
               absr_rlse_id   = schd_rlse_id
               absr_date      = schd_date
               absr_time      = schd_time
               absr_interval  = schd_interval
               absr_reference = schd_reference
               absr_ship_id   = shipid
               net_req        = schd_cum_qty - sod_cum_qty[1] - new_all_qty
               absr_qty       = if net_req >= work_qty
                                then work_qty else net_req
               schd_all_qty   = schd_all_qty + absr_qty
               work_qty       = work_qty - absr_qty
               new_all_qty    = new_all_qty + absr_qty.

            if recid(absr_det) = -1
            then.

         end. /* IF AVAILABLE schd_det */

         /**************************************************/
         /* SHIP QTY IS GREATER THAN REQUIREMENTS          */
         /**************************************************/
         else
         do:
            msgtext = "".

            {gprun.i ""gpcfmsg.p"" "(input 1528,
                                     input 0,
                                     input program-name(1),
                                     input so_site,
                                     input so_ship,
                                     input msgtext,
                                     input true,
                                     output errlevel)"}
/*GUI*/ if global-beam-me-up then undo, leave.


            if errlevel > 0
            then
               pause.

            next MAIN.
         end.
      end. /* IF so_bump_all REPEAT */

      /*****************************************************/
      /* DYNAMIC UNPEGGING DISABLED                        */
      /*****************************************************/
      else
      repeat while work_qty > 0:
/*GUI*/ if global-beam-me-up then undo, leave.


         if first_schd
         then
            find first schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and schd_cum_qty - sod_cum_qty[1] - tot_all_qty > 0
            exclusive-lock no-error.
         else
            find next schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and schd_cum_qty - sod_cum_qty[1] - tot_all_qty > 0
            exclusive-lock no-error.

         first_schd = false.

         if available schd_det
         then do:

            /***********************************************/
            /* REQUIREMENT FOUND - PEG IT                  */
            /***********************************************/
            create absr_det.
            assign
               absr_shipfrom  = abs_shipfrom
               absr_id        = abs_id
               absr_type      = schd_type
               absr_nbr       = schd_nbr
               absr_line      = schd_line
               absr_rlse_id   = schd_rlse_id
               absr_date      = schd_date
               absr_time      = schd_time
               absr_interval  = schd_interval
               absr_reference = schd_reference
               absr_ship_id   = shipid
               net_req        = schd_cum_qty - sod_cum_qty[1] - tot_all_qty
               absr_qty       = if net_req >= work_qty
                                then work_qty else net_req
               schd_all_qty   = schd_all_qty + absr_qty
               work_qty       = work_qty - absr_qty
               tot_all_qty    = tot_all_qty + absr_qty.

            if recid(absr_det) = -1
            then.

         end. /* IF AVAILABLE schd_det */

         /**************************************************/
         /* SHIP QTY IS GREATER THAN REQUIREMENTS          */
         /**************************************************/
         else
         do:

            msgtext = "".

            {gprun.i ""gpcfmsg.p"" "(input 1528,
                                     input 0,
                                     input program-name(1),
                                     input so_site,
                                     input so_ship,
                                     input msgtext,
                                     input true,
                                     output errlevel)"}
/*GUI*/ if global-beam-me-up then undo, leave.


            if errlevel > 0
            then
               pause.

            next MAIN.
         end.
      end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* IF NOT so_bump_all REPEAT */
   end. /* IF so_cum_acct */

   /********************************************************/
   /* SCHEDULED ORDER USES DISCRETE QTY ACCOUNTING         */
   /********************************************************/
   else
   do:

      /*****************************************************/
      /* DYNAMIC UNPEGGING ENABLED                         */
      /*****************************************************/

      /* IGNORE THE DYNAMIC UNPEG WHEN DOING THE AUTOMATIC FIFO    */
      /* PEGGING DURING THE SHIPPER LINE CREATION IN P/S WORKBENCH */

      if so_bump_all and execname <> "rcshwb.p"
      then
      repeat while work_qty > 0:
/*GUI*/ if global-beam-me-up then undo, leave.


         if first_schd
         then
            find first schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and ((schd_date =  due_date   and
                       schd_date <  due_date1  and
                       schd_time >= due_time)  or
                      (schd_date >  due_date   and
                       schd_date <  due_date1) or
                      (schd_date >  due_date   and
                       schd_date =  due_date1  and
                       schd_time <= due_time1) or
                      (schd_date =  due_date   and
                       schd_date =  due_date1  and
                       schd_time >= due_time   and
                       schd_time <= due_time1))
                 and schd_reference >= ref
                 and schd_reference <= ref1
                 and (if peg_fifo
                      then true else schd_reference = abs__qad04)
            exclusive-lock no-error.
         else
            find next schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and ((schd_date =  due_date   and
                       schd_date <  due_date1  and
                       schd_time >= due_time)  or
                      (schd_date >  due_date   and
                       schd_date <  due_date1) or
                      (schd_date >  due_date   and
                       schd_date =  due_date1  and
                       schd_time <= due_time1) or
                      (schd_date =  due_date   and
                       schd_date =  due_date1  and
                       schd_time >= due_time   and
                       schd_time <= due_time1))
                 and schd_reference >= ref
                 and schd_reference <= ref1
                 and (if peg_fifo
                      then true else schd_reference = abs__qad04)
            exclusive-lock no-error.

         first_schd = false.

         if available schd_det
         then
         DEL_ABSR1:
         do on error undo, leave:

            if schd_discr_qty <> 0 and
               (schd_ship_qty / schd_discr_qty * 100
                  < ship_cmplt)
            then do:
               bump_qty   = work_qty.

               for each absr_det
                  where absr_cnfrmd  = no
                    and absr_type      = schd_type
                    and absr_nbr       = schd_nbr
                    and absr_line      = schd_line
                    and absr_rlse_id   = schd_rlse_id
                    and absr_date      = schd_date
                    and absr_time      = schd_time
                    and absr_interval  = schd_interval
                    and absr_reference = schd_reference
                    and absr_ship_id   <> shipid
               exclusive-lock
               by absr_ship_id
               by absr_id:

                  /********************************************/
                  /* UNPEG ABSR_DET UNTIL:                    */
                  /*                                          */
                  /*    THE REQUIREMENT QTY IS MET            */
                  /*                -AND-                     */
                  /*    ALL ABSR_DET'S IN THE SAME CONTAINER, */
                  /*    PEGGED TO THE SAME SCHD_DET RECORD    */
                  /*    ARE UNPEGGED                          */
                  /*                -OR-                      */
                  /*    THERE AREN'T ANYMORE ABSR_DET'S LEFT  */
                  /********************************************/
                  if bump_qty = 0
                     and substring(absr_id,1,8) <> old_absr_id
                  then
                     leave.

                  assign
                     old_absr_id  = substring(absr_id,1,8)
                     schd_all_qty = max(schd_all_qty - absr_qty,0)
                     bump_qty     = max(bump_qty - absr_qty,0).

                  delete absr_det.

               end. /* FOR EACH absr_det */

               /***********************************************/
               /* IF STILL OVER SHIP_CMPLT FLAG AFTER BUMPING */
               /* THEN UNDO BUMPING, FIND NEXT RECORD.        */
               /***********************************************/
               if (schd_ship_qty + schd_all_qty - new_all_qty) /
                   schd_discr_qty * 100 > ship_cmplt
               then
                  undo DEL_ABSR1, next.

               /***********************************************/
               /* REQUIREMENT FOUND - PEG IT                  */
               /***********************************************/
               create absr_det.
               assign
                  absr_shipfrom  = abs_shipfrom
                  absr_id        = abs_id
                  absr_type      = schd_type
                  absr_nbr       = schd_nbr
                  absr_line      = schd_line
                  absr_rlse_id   = schd_rlse_id
                  absr_date      = schd_date
                  absr_time      = schd_time
                  absr_interval  = schd_interval
                  absr_reference = schd_reference
                  absr_ship_id   = shipid
                  net_req        = schd_discr_qty - schd_ship_qty -
                                   schd_all_qty
                  absr_qty       = if net_req >= work_qty
                                   then work_qty else net_req
                  schd_all_qty   = schd_all_qty + absr_qty
                  work_qty       = work_qty - absr_qty
                  new_all_qty    = if first-of(abs_par_id)
                                   then absr_qty
                                   else new_all_qty + absr_qty
                  new_all_qty    = if last-of(abs_par_id)
                                   then 0 else new_all_qty.

               if recid(absr_det) = -1
               then.

            end. /* IF schd_discr_qty <> 0 AND .. */
         end. /* IF AVAILABLE schd_det */

         /**************************************************/
         /* SHIP QTY IS GREATER THAN REQUIREMENTS          */
         /**************************************************/
         else
         do:

            msgtext = "".

            {gprun.i ""gpcfmsg.p"" "(input 1528,
                                     input 0,
                                     input program-name(1),
                                     input so_site,
                                     input so_ship,
                                     input msgtext,
                                     input true,
                                     output errlevel)"}
/*GUI*/ if global-beam-me-up then undo, leave.


            if errlevel > 0
            then
               pause.

            next MAIN.
         end.
      end. /* IF so_bump_all REPEAT */

      /*****************************************************/
      /* DYNAMIC UNPEGGING DISABLED                        */
      /*****************************************************/
      else
      repeat while work_qty > 0:
/*GUI*/ if global-beam-me-up then undo, leave.


         if first_schd
         then
            find first schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and ((schd_date =  due_date   and
                       schd_date <  due_date1  and
                       schd_time >= due_time)  or
                      (schd_date >  due_date   and
                       schd_date <  due_date1) or
                      (schd_date >  due_date   and
                       schd_date =  due_date1  and
                       schd_time <= due_time1) or
                      (schd_date =  due_date   and
                       schd_date =  due_date1  and
                       schd_time >= due_time   and
                       schd_time <= due_time1))
                 and schd_reference >= ref
                 and schd_reference <= ref1
                 and (if peg_fifo
                      then true else schd_reference = abs__qad04)
                 and (schd_discr_qty - schd_ship_qty - schd_all_qty > 0)
               exclusive-lock no-error.
         else
            find next schd_det
               where schd_type      = 3
                 and schd_nbr       = sod_nbr
                 and schd_line      = sod_line
                 and schd_rlse_id   = sod_curr_rlse_id[3]
                 and ((schd_date =  due_date   and
                       schd_date <  due_date1  and
                       schd_time >= due_time)  or
                      (schd_date >  due_date   and
                       schd_date <  due_date1) or
                      (schd_date >  due_date   and
                       schd_date =  due_date1  and
                       schd_time <= due_time1) or
                      (schd_date =  due_date   and
                       schd_date =  due_date1  and
                       schd_time >= due_time   and
                       schd_time <= due_time1))
                 and schd_reference >= ref
                 and schd_reference <= ref1
                 and (if peg_fifo
                      then true else schd_reference = abs__qad04)
                 and (schd_discr_qty - schd_ship_qty - schd_all_qty > 0)
               exclusive-lock no-error.

         first_schd = false.

         if available schd_det and
            schd_discr_qty <> 0 and
            ((schd_ship_qty + schd_all_qty - new_all_qty) /
            schd_discr_qty * 100 < ship_cmplt)
         then do:

            /***********************************************/
            /* REQUIREMENT FOUND - PEG IT                  */
            /***********************************************/
            create absr_det.
            assign
               absr_shipfrom  = abs_shipfrom
               absr_id        = abs_id
               absr_type      = schd_type
               absr_nbr       = schd_nbr
               absr_line      = schd_line
               absr_rlse_id   = schd_rlse_id
               absr_date      = schd_date
               absr_time      = schd_time
               absr_interval  = schd_interval
               absr_reference = schd_reference
               absr_ship_id   = shipid
               net_req        = schd_discr_qty - schd_ship_qty - schd_all_qty
               absr_qty       = if net_req >= work_qty
                                then work_qty else net_req
               schd_all_qty   = schd_all_qty + absr_qty
               work_qty       = work_qty - absr_qty
               new_all_qty    = if first-of(abs_par_id)
                                then absr_qty
                                else new_all_qty + absr_qty
               new_all_qty    = if last-of(abs_par_id)
                                then 0 else new_all_qty.

            if recid(absr_det) = -1
            then.

         end. /* IF AVAILABLE schd_det */

         /**************************************************/
         /* SHIP QTY IS GREATER THAN REQUIREMENTS          */
         /**************************************************/
         else
         do:

            msgtext = "".

            {gprun.i ""gpcfmsg.p"" "(input 1528,
                                     input 0,
                                     input program-name(1),
                                     input so_site,
                                     input so_ship,
                                     input msgtext,
                                     input true,
                                     output errlevel)"}
/*GUI*/ if global-beam-me-up then undo, leave.


            if errlevel > 0
            then
               pause.

            next MAIN.

         end. /* IF NOT AVAILABLE schd_det */
      end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* IF NOT so_bump_all */
   end. /* IF NOT so_cum_acct */
end. /* FOR EACH work_abs_mstr */

if errlevel > 2
then do:

   {gprun.i ""rcctwbu1.p"" "(input abs_recid,
                             input yes,
                             input yes,
                             input l_delproc,
                             output undotran)"}
/*GUI*/ if global-beam-me-up then undo, leave.

   if undotran
   then
      return.

   find abs_mstr
      where recid(abs_mstr) = abs_recid
      exclusive-lock.

   delete abs_mstr.

   return.
end.
